package com.cnap.multiclouldmgmt.model.vm;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * 云主机的相关信息
 * @author dyq
 */
@ApiModel(value = "com.cnap.multiclouldmgmt.model.vm.VmModel",description = "虚拟机相关信息")
public class VmModel {

    //主机id
    @ApiModelProperty(value = "主机id")
    private String vmId;

    //主机名称
    @ApiModelProperty(value = "主机名称")
    private String vmName;

    //名称
    @ApiModelProperty(value = "主机名称")
    private String name;

    //cpu核数
    @ApiModelProperty(value = "cpu核数")
    private int cpuNum;

    //内存的大小，G为单位
    @ApiModelProperty(value = "内存的大小，G为单位")
    private int memByG;

    //硬盘的大小，G为单位
    @ApiModelProperty(value = "硬盘的大小，G为单位")
    private int diskByG;

    @ApiModelProperty(value = "用于区分云商")
    private String businessId;

    @ApiModelProperty(value = "云商")
    private String cloudType;

    //外网ip
    @ApiModelProperty(value = "外网ip")
    private String externalIp;

    //内网ip
    @ApiModelProperty(value = "内网ip")
    private String innerIp;

    //密码
    @ApiModelProperty(value = "密码")
    private String passwd;

    //falavorId
    @ApiModelProperty(value = "favorId")
    private String flavorId;

    //imageId
    @ApiModelProperty(value = "imageId")
    private String imageId;

    //regionId
    @ApiModelProperty(value = "regionId")
    private String regionId;

    //zoneId
    @ApiModelProperty(value = "zoneId")
    private String zoneId;

    //sysDiskSize
    @ApiModelProperty(value = "sysDiskSize")
    private int sysDiskSize;

    //sysDiskType
    @ApiModelProperty(value = "sysDiskType")
    private String sysDiskType;

    //dataDisks
    @ApiModelProperty(value = "dataDisks")
    private List<DataDiskModel> dataDisks;

    //bandwidth
    @ApiModelProperty(value = "bandwidth")
    private int bandwidth;

    //vmChargeType
    @ApiModelProperty(value = "vmChargeType")
    private String vmChargeType;

    //chargeUnit
    @ApiModelProperty(value = "chargeUnit")
    private String chargeUnit;

    //chargeCount
    @ApiModelProperty(value = "chargeCount")
    private int chargeCount;

    //eipChargeType
    @ApiModelProperty(value = "eipChargeType")
    private String eipChargeType;

    //k8sCluterRole
    @ApiModelProperty(value = "k8sCluterRole")
    private String k8sCluterRole;

    //createTimestamp
    @ApiModelProperty(value = "createTimestamp")
    private long createTimeStamp;


    //addclusterName 如果是新建集群或者扩容，就需要知道集群名称才能继续
    @ApiModelProperty(value = "addclusterName")
    private String addclusterName;

    //用于扩缩容的svcId label
    @ApiModelProperty(value = "svcIdLabelValue")
    private String svcIdLabelValue;

    //用于扩缩容的svc name label
    @ApiModelProperty(value = "svcNameLabelValue")
    private String svcNameLabelValue;

    @ApiModelProperty(value = "cpu还是gpu")
    private String arch;
    //创建者
    @ApiModelProperty(value = "accountName")
    private String accountName;

    //用户
    @ApiModelProperty(value = "userName")
    private String userName;




    /**
     * 云平台返回的
     * 虚拟机相关的数据
     */
    //cpId
    private String cpId;
    //cpNsgIdsJson
    private String cpNsgIdsJson;
    //cpRegionId
    private String cpRegionId;
    //cpSubnetId
    private String cpSubnetId;
    //cpVpcId
    private String cpVpcId;
    //cpZoneId
    private String cpZoneId;
    //cpuCount
    private int cpuCount;
    //createTime
    private int createTime;
    //dataDisk
    private int dataDisk;
    //eipBandwidthMb
    private int eipBandwidthMb;
    //flavorName
    private String flavorName;
    //imageName
    private String imageName;
    //instanceType
    private String instanceType;
    //loginPassword
    private String loginPassword;
    //loginUser
    private String loginUser;
    //memSize
    private int memSize;
    //notes
    private String notes;
    //osPlatform
    private String osPlatform;
    //privateIpAddress
    private String privateIpAddress;
    //publicIpAddress
    private String publicIpAddress;
    //regionName
    private String regionName;
    //runStatus
    private String runStatus;
    //systemDisk
    private int systemDisk;
    //userId
    private int userId;
    //cnapMsg
    private String cnapMsg;
    //category
    private String category;

    private int packageFlag;

    private String gpuFlavor;

    /**
     * get
     *
     * @return GpuFlavor
     */
    public String getGpuFlavor() {
        return gpuFlavor;
    }

    /**
     * set
     *
     * @param gpuFlavor gpuFlavor
     */
    public void setGpuFlavor(String gpuFlavor) {
        this.gpuFlavor = gpuFlavor;
    }

    /**
     * get
     *
     * @return AccountName
     */
    public String getAccountName() {
        return accountName;
    }

    /**
     * set
     *
     * @param accountName accountName
     */
    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    /**
     * get
     *
     * @return AddclusterName
     */
    public String getAddclusterName() {
        return addclusterName;
    }

    /**
     * set
     *
     * @param addclusterName addclusterName
     */
    public void setAddclusterName(String addclusterName) {
        this.addclusterName = addclusterName;
    }

    /**
     * get
     *
     * @return PackageFlag
     */
    public int getPackageFlag() {
        return packageFlag;
    }

    /**
     * set
     *
     * @param packageFlag packageFlag
     */
    public void setPackageFlag(int packageFlag) {
        this.packageFlag = packageFlag;
    }

    /**
     * get
     *
     * @return CreateTimeStamp
     */
    public long getCreateTimeStamp() {
        return createTimeStamp;
    }

    /**
     * set
     *
     * @param createTimeStamp createTimeStamp
     */
    public void setCreateTimeStamp(long createTimeStamp) {
        this.createTimeStamp = createTimeStamp;
    }

    /**
     * get
     *
     * @return Category
     */
    public String getCategory() {
        return category;
    }

    /**
     * set
     *
     * @param category category
     */
    public void setCategory(String category) {
        this.category = category;
    }

    /**
     * get
     *
     * @return CnapMsg
     */
    public String getCnapMsg() {
        return cnapMsg;
    }

    /**
     * set
     *
     * @param cnapMsg cnapMsg
     */
    public void setCnapMsg(String cnapMsg) {
        this.cnapMsg = cnapMsg;
    }

    /**
     * get
     *
     * @return CpId
     */
    public String getCpId() {
        return cpId;
    }

    /**
     * set
     *
     * @param cpId cpId
     */
    public void setCpId(String cpId) {
        this.cpId = cpId;
    }

    /**
     * get
     *
     * @return CpNsgIdsJson
     */
    public String getCpNsgIdsJson() {
        return cpNsgIdsJson;
    }

    /**
     * set
     *
     * @param cpNsgIdsJson cpNsgIdsJson
     */
    public void setCpNsgIdsJson(String cpNsgIdsJson) {
        this.cpNsgIdsJson = cpNsgIdsJson;
    }

    /**
     * get
     *
     * @return CpRegionId
     */
    public String getCpRegionId() {
        return cpRegionId;
    }

    /**
     * set
     *
     * @param cpRegionId cpRegionId
     */
    public void setCpRegionId(String cpRegionId) {
        this.cpRegionId = cpRegionId;
    }

    /**
     * get
     *
     * @return CpSubnetId
     */
    public String getCpSubnetId() {
        return cpSubnetId;
    }

    /**
     * set
     *
     * @param cpSubnetId cpSubnetId
     */
    public void setCpSubnetId(String cpSubnetId) {
        this.cpSubnetId = cpSubnetId;
    }

    /**
     * get
     *
     * @return CpVpcId
     */
    public String getCpVpcId() {
        return cpVpcId;
    }

    /**
     * set
     *
     * @param cpVpcId cpVpcId
     */
    public void setCpVpcId(String cpVpcId) {
        this.cpVpcId = cpVpcId;
    }

    /**
     * get
     *
     * @return CpZoneId
     */
    public String getCpZoneId() {
        return cpZoneId;
    }

    /**
     * set
     *
     * @param cpZoneId cpZoneId
     */
    public void setCpZoneId(String cpZoneId) {
        this.cpZoneId = cpZoneId;
    }

    /**
     * get
     *
     * @return CpuCount
     */
    public int getCpuCount() {
        return cpuCount;
    }

    /**
     * set
     *
     * @param cpuCount cpuCount
     */
    public void setCpuCount(int cpuCount) {
        this.cpuCount = cpuCount;
    }

    /**
     * get
     *
     * @return CreateTime
     */
    public int getCreateTime() {
        return createTime;
    }

    /**
     * set
     *
     * @param createTime createTime
     */
    public void setCreateTime(int createTime) {
        this.createTime = createTime;
    }

    /**
     * get
     *
     * @return DataDisk
     */
    public int getDataDisk() {
        return dataDisk;
    }

    /**
     * set
     *
     * @param dataDisk dataDisk
     */
    public void setDataDisk(int dataDisk) {
        this.dataDisk = dataDisk;
    }

    /**
     * get
     *
     * @return EipBandwidthMb
     */
    public int getEipBandwidthMb() {
        return eipBandwidthMb;
    }

    /**
     * set
     *
     * @param eipBandwidthMb eipBandwidthMb
     */
    public void setEipBandwidthMb(int eipBandwidthMb) {
        this.eipBandwidthMb = eipBandwidthMb;
    }

    /**
     * get
     *
     * @return FlavorName
     */
    public String getFlavorName() {
        return flavorName;
    }

    /**
     * set
     *
     * @param flavorName flavorName
     */
    public void setFlavorName(String flavorName) {
        this.flavorName = flavorName;
    }

    /**
     * get
     *
     * @return ImageName
     */
    public String getImageName() {
        return imageName;
    }

    /**
     * set
     *
     * @param imageName imageName
     */
    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    /**
     * get
     *
     * @return InstanceType
     */
    public String getInstanceType() {
        return instanceType;
    }

    /**
     * set
     *
     * @param instanceType instanceType
     */
    public void setInstanceType(String instanceType) {
        this.instanceType = instanceType;
    }

    /**
     * get
     *
     * @return LoginPassword
     */
    public String getLoginPassword() {
        return loginPassword;
    }

    /**
     * set
     *
     * @param loginPassword loginPassword
     */
    public void setLoginPassword(String loginPassword) {
        this.loginPassword = loginPassword;
    }

    /**
     * get
     *
     * @return LoginUser
     */
    public String getLoginUser() {
        return loginUser;
    }

    /**
     * set
     *
     * @param loginUser loginUser
     */
    public void setLoginUser(String loginUser) {
        this.loginUser = loginUser;
    }

    /**
     * get
     *
     * @return MemSize
     */
    public int getMemSize() {
        return memSize;
    }

    /**
     * set
     *
     * @param memSize memSize
     */
    public void setMemSize(int memSize) {
        this.memSize = memSize;
    }

    /**
     * get
     *
     * @return Notes
     */
    public String getNotes() {
        return notes;
    }

    /**
     * set
     *
     * @param notes notes
     */
    public void setNotes(String notes) {
        this.notes = notes;
    }

    /**
     * get
     *
     * @return OsPlatform
     */
    public String getOsPlatform() {
        return osPlatform;
    }

    /**
     * set
     *
     * @param osPlatform osPlatform
     */
    public void setOsPlatform(String osPlatform) {
        this.osPlatform = osPlatform;
    }

    /**
     * get
     *
     * @return PrivateIpAddress
     */
    public String getPrivateIpAddress() {
        return privateIpAddress;
    }

    /**
     * set
     *
     * @param privateIpAddress privateIpAddress
     */
    public void setPrivateIpAddress(String privateIpAddress) {
        this.privateIpAddress = privateIpAddress;
    }

    /**
     * get
     *
     * @return PublicIpAddress
     */
    public String getPublicIpAddress() {
        return publicIpAddress;
    }

    /**
     * set
     *
     * @param publicIpAddress publicIpAddress
     */
    public void setPublicIpAddress(String publicIpAddress) {
        this.publicIpAddress = publicIpAddress;
    }

    /**
     * get
     *
     * @return RegionName
     */
    public String getRegionName() {
        return regionName;
    }

    /**
     * set
     *
     * @param regionName regionName
     */
    public void setRegionName(String regionName) {
        this.regionName = regionName;
    }

    /**
     * get
     *
     * @return RunStatus
     */
    public String getRunStatus() {
        return runStatus;
    }

    /**
     * set
     *
     * @param runStatus runStatus
     */
    public void setRunStatus(String runStatus) {
        this.runStatus = runStatus;
    }

    /**
     * get
     *
     * @return SystemDisk
     */
    public int getSystemDisk() {
        return systemDisk;
    }

    /**
     * set
     *
     * @param systemDisk systemDisk
     */
    public void setSystemDisk(int systemDisk) {
        this.systemDisk = systemDisk;
    }

    /**
     * get
     *
     * @return UserId
     */
    public int getUserId() {
        return userId;
    }

    /**
     * set
     *
     * @param userId userId
     */
    public void setUserId(int userId) {
        this.userId = userId;
    }

    /**
     * get
     *
     * @return UserName
     */
    public String getUserName() {
        return userName;
    }

    /**
     * set
     *
     * @param userName userName
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * get
     *
     * @return SysDiskType
     */
    public String getSysDiskType() {
        return sysDiskType;
    }

    /**
     * set
     *
     * @param sysDiskType sysDiskType
     */
    public void setSysDiskType(String sysDiskType) {
        this.sysDiskType = sysDiskType;
    }

    /**
     * get
     *
     * @return K8sCluterRole
     */
    public String getK8sCluterRole() {
        return k8sCluterRole;
    }

    /**
     * set
     *
     * @param k8sCluterRole k8sCluterRole
     */
    public void setK8sCluterRole(String k8sCluterRole) {
        this.k8sCluterRole = k8sCluterRole;
    }

    /**
     * get
     *
     * @return MemByG
     */
    public int getMemByG() {
        return memByG;
    }

    /**
     * set
     *
     * @param memByG memByG
     */
    public void setMemByG(int memByG) {
        this.memByG = memByG;
    }

    /**
     * get
     *
     * @return DiskByG
     */
    public int getDiskByG() {
        return diskByG;
    }

    /**
     * set
     *
     * @param diskByG diskByG
     */
    public void setDiskByG(int diskByG) {
        this.diskByG = diskByG;
    }

    /**
     * get
     *
     * @return VmId
     */
    public String getVmId() {
        return vmId;
    }

    /**
     * set
     *
     * @param vmId vmId
     */
    public void setVmId(String vmId) {
        this.vmId = vmId;
    }

    /**
     * get
     *
     * @return CpuNum
     */
    public int getCpuNum() {
        return cpuNum;
    }

    /**
     * set
     *
     * @param cpuNum cpuNum
     */
    public void setCpuNum(int cpuNum) {
        this.cpuNum = cpuNum;
    }

    /**
     * get
     *
     * @return BusinessId
     */
    public String getBusinessId() {
        return businessId;
    }

    /**
     * set
     *
     * @param businessId businessId
     */
    public void setBusinessId(String businessId) {
        this.businessId = businessId;
    }

    /**
     * get
     *
     * @return VmName
     */
    public String getVmName() {
        return vmName;
    }

    /**
     * set
     *
     * @param vmName vmName
     */
    public void setVmName(String vmName) {
        this.vmName = vmName;
    }

    /**
     * get
     *
     * @return ExternalIp
     */
    public String getExternalIp() {

        if (StringUtils.isEmpty(externalIp)&&StringUtils.isNotEmpty(publicIpAddress)){
            externalIp = publicIpAddress.replace("[","").replace("]","");
        }

        return externalIp;
    }

    /**
     * set
     *
     * @param externalIp externalIp
     */
    public void setExternalIp(String externalIp) {
        this.externalIp = externalIp;
    }

    /**
     * get
     *
     * @return InnerIp
     */
    public String getInnerIp() {

        if (StringUtils.isEmpty(innerIp)&&StringUtils.isNotEmpty(privateIpAddress)){
            innerIp = privateIpAddress.replace("[","").replace("]","");
        }

        return innerIp;
    }

    /**
     * set
     *
     * @param innerIp innerIp
     */
    public void setInnerIp(String innerIp) {
        this.innerIp = innerIp;
    }

    /**
     * get
     *
     * @return Passwd
     */
    public String getPasswd() {

        if (StringUtils.isEmpty(passwd)){
            passwd = loginPassword;
        }

        return passwd;
    }

    /**
     * set
     *
     * @param passwd passwd
     */
    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    /**
     * get
     *
     * @return Name
     */
    public String getName() {
        return name;
    }

    /**
     * set
     *
     * @param name name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * get
     *
     * @return CloudType
     */
    public String getCloudType() {
        return cloudType;
    }

    /**
     * set
     *
     * @param cloudType cloudType
     */
    public void setCloudType(String cloudType) {
        this.cloudType = cloudType;
    }

    /**
     * get
     *
     * @return FlavorId
     */
    public String getFlavorId() {
        return flavorId;
    }

    /**
     * set
     *
     * @param flavorId flavorId
     */
    public void setFlavorId(String flavorId) {
        this.flavorId = flavorId;
    }

    /**
     * get
     *
     * @return ImageId
     */
    public String getImageId() {
        return imageId;
    }

    /**
     * set
     *
     * @param imageId imageId
     */
    public void setImageId(String imageId) {
        this.imageId = imageId;
    }

    /**
     * get
     *
     * @return RegionId
     */
    public String getRegionId() {
        return regionId;
    }

    /**
     * set
     *
     * @param regionId regionId
     */
    public void setRegionId(String regionId) {
        this.regionId = regionId;
    }

    /**
     * get
     *
     * @return ZoneId
     */
    public String getZoneId() {
        return zoneId;
    }

    /**
     * set
     *
     * @param zoneId zoneId
     */
    public void setZoneId(String zoneId) {
        this.zoneId = zoneId;
    }

    /**
     * get
     *
     * @return SysDiskSize
     */
    public int getSysDiskSize() {
        return sysDiskSize;
    }

    /**
     * set
     *
     * @param sysDiskSize sysDiskSize
     */
    public void setSysDiskSize(int sysDiskSize) {
        this.sysDiskSize = sysDiskSize;
    }

    /**
     * get
     *
     * @return DataDisks
     */
    public List<DataDiskModel> getDataDisks() {
        return dataDisks;
    }

    /**
     * set
     *
     * @param dataDisks dataDisks
     */
    public void setDataDisks(List<DataDiskModel> dataDisks) {
        this.dataDisks = dataDisks;
    }

    /**
     * get
     *
     * @return Bandwidth
     */
    public int getBandwidth() {
        return bandwidth;
    }

    /**
     * set
     *
     * @param bandwidth bandwidth
     */
    public void setBandwidth(int bandwidth) {
        this.bandwidth = bandwidth;
    }

    /**
     * get
     *
     * @return VmChargeType
     */
    public String getVmChargeType() {
        return vmChargeType;
    }

    /**
     * set
     *
     * @param vmChargeType vmChargeType
     */
    public void setVmChargeType(String vmChargeType) {
        this.vmChargeType = vmChargeType;
    }

    /**
     * get
     *
     * @return ChargeUnit
     */
    public String getChargeUnit() {
        return chargeUnit;
    }

    /**
     * set
     *
     * @param chargeUnit chargeUnit
     */
    public void setChargeUnit(String chargeUnit) {
        this.chargeUnit = chargeUnit;
    }

    /**
     * get
     *
     * @return ChargeCount
     */
    public int getChargeCount() {
        return chargeCount;
    }

    /**
     * set
     *
     * @param chargeCount chargeCount
     */
    public void setChargeCount(int chargeCount) {
        this.chargeCount = chargeCount;
    }

    /**
     * get
     *
     * @return EipChargeType
     */
    public String getEipChargeType() {
        return eipChargeType;
    }

    /**
     * set
     *
     * @param eipChargeType eipChargeType
     */
    public void setEipChargeType(String eipChargeType) {
        this.eipChargeType = eipChargeType;
    }

    /**
     * get
     *
     * @return SvcIdLabelValue
     */
    public String getSvcIdLabelValue() {
        return svcIdLabelValue;
    }

    /**
     * set
     *
     * @param svcIdLabelValue svcIdLabelValue
     */
    public void setSvcIdLabelValue(String svcIdLabelValue) {
        this.svcIdLabelValue = svcIdLabelValue;
    }

    /**
     * get
     *
     * @return SvcNameLabelValue
     */
    public String getSvcNameLabelValue() {
        return svcNameLabelValue;
    }

    /**
     * set
     *
     * @param svcNameLabelValue svcNameLabelValue
     */
    public void setSvcNameLabelValue(String svcNameLabelValue) {
        this.svcNameLabelValue = svcNameLabelValue;
    }

    /**
     * get
     *
     * @return Arch
     */
    public String getArch() {
        return arch;
    }

    /**
     * set
     *
     * @param arch arch
     */
    public void setArch(String arch) {
        this.arch = arch;
    }
}
